<div class="main-container">
  <div class="row">
    <div fGrid="6" class="free-demo-board">
      <p>
        {{'DEMO.SWITCH.DESCRIPTION' | translate}}
      </p>
      <hr>
      <h3 class="free-head-title">{{'API-OPTION' | translate}}<span class="symbol component"></span></h3>

      <div class="free-demo-row">
        <h3 class="free-title">free-switch</h3>
        <p>{{'COMPONENT.SWITCH' | translate}}</p>
        <free-table>
          <free-table-header>
            <free-table-row>
              <free-table-head><ng-template>{{'PROPERTY' | translate}}</ng-template></free-table-head>
              <free-table-head><ng-template>{{'TYPE' | translate}}</ng-template></free-table-head>
              <free-table-head><ng-template>{{'DESCRIPTION' | translate}}</ng-template></free-table-head>
            </free-table-row>
          </free-table-header>

          <free-table-body>
            <free-table-row>
              <free-table-cell>label</free-table-cell>
              <free-table-cell>
                <ng-template><code>String</code></ng-template>
              </free-table-cell>
              <free-table-cell>
                <ng-template>{{'DEMO.SWITCH.OPTION.0' | translate}}</ng-template>
              </free-table-cell>
            </free-table-row>
            <free-table-row>
              <free-table-cell>theme</free-table-cell>
              <free-table-cell>
                <ng-template><code>String</code></ng-template>
              </free-table-cell>
              <free-table-cell>
                <ng-template>
                  {{'DEMO.SWITCH.OPTION.1' | translate}}(primary/info/success/warning/danger)
                </ng-template>
              </free-table-cell>
            </free-table-row>
            <free-table-row>
              <free-table-cell>type</free-table-cell>
              <free-table-cell>
                <ng-template><code>String</code></ng-template>
              </free-table-cell>
              <free-table-cell>
                <ng-template>{{'DEMO.SWITCH.OPTION.2' | translate}}</ng-template>
              </free-table-cell>
            </free-table-row>
            <free-table-row>
              <free-table-cell>checked</free-table-cell>
              <free-table-cell>
                <ng-template><code>Boolean</code></ng-template>
              </free-table-cell>
              <free-table-cell>
                <ng-template>{{'DEMO.SWITCH.OPTION.3' | translate}}</ng-template>
              </free-table-cell>
            </free-table-row>
            <free-table-row>
              <free-table-cell>disabled</free-table-cell>
              <free-table-cell>
                <ng-template><code>Boolean</code></ng-template>
              </free-table-cell>
              <free-table-cell>
                <ng-template>{{'DEMO.SWITCH.OPTION.4' | translate}}</ng-template>
              </free-table-cell>
            </free-table-row>
          </free-table-body>
        </free-table>
        <h3 class="free-title">{{'EVENT' | translate}}</h3>
        <free-table>
          <free-table-header>
            <free-table-row>
              <free-table-head><ng-template>{{'EVENT' | translate}}</ng-template></free-table-head>
              <free-table-head><ng-template>{{'DESCRIPTION' | translate}}</ng-template></free-table-head>
            </free-table-row>
          </free-table-header>

          <free-table-body>
            <free-table-row>
              <free-table-cell>onChange</free-table-cell>
              <free-table-cell>
                <ng-template>
                  {{'DEMO.SWITCH.EVENTS.0' | translate}}
                </ng-template>
              </free-table-cell>
            </free-table-row>
          </free-table-body>
        </free-table>
      </div>
    </div>

    <div class="free-demo-board" fGrid="6">
      <div class="free-demo-board">
        <div class="free-card-board">
          <h3 class="free-toolbar">Import</h3>
          <free-tab-group direction="right" theme="line">
            <free-tab header="CODE">
              <free-code lang="typescript">
                import &#123;SwitchModule&#125; from 'freeng/freeng';
              </free-code>
            </free-tab>
          </free-tab-group>
        </div>
      </div>

      <div class="free-card-board">
        <h3 class="free-toolbar">Default</h3>
        <free-tab-group direction="right">
          <free-tab header="PREVIEW">
            <p style="width: 100%">当前状态：{{checked}}</p>
            <p>
              <free-switch label="Switch" [(ngModel)]="checked"></free-switch>
              <free-switch label="Switch" type="2" [checked]="true"></free-switch>
              <free-switch label="Switch" type="3"></free-switch>
            </p>
          </free-tab>
          <free-tab header="CODE">
            <free-code lang="html">
              &lt;free-switch label="Switch"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" type="2" [checked]="true"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" type="3"&gt;&lt;/free-switch&gt;
            </free-code>
          </free-tab>
        </free-tab-group>
      </div>

      <div class="free-card-board">
        <h3 class="free-toolbar">Disabled</h3>
        <free-tab-group direction="right">
          <free-tab header="PREVIEW">
            <free-switch label="Switch" [disabled]="true"></free-switch>
          </free-tab>
          <free-tab header="CODE">
            <free-code lang="html">
              &lt;free-switch label="Switch" [disabled]="true"&gt;&lt;/free-switch&gt;
            </free-code>
          </free-tab>
        </free-tab-group>
      </div>

      <div class="free-card-board">
        <h3 class="free-toolbar">Theme</h3>
        <free-tab-group direction="right">
          <free-tab header="PREVIEW">
            <free-switch label="Switch"></free-switch>
            <free-switch label="Switch" theme="primary"></free-switch>
            <free-switch label="Switch" theme="info"></free-switch>
            <free-switch label="Switch" theme="success"></free-switch>
            <free-switch label="Switch" theme="warning"></free-switch>
            <free-switch label="Switch" theme="danger"></free-switch>
          </free-tab>
          <free-tab header="CODE">
            <free-code lang="html">
              &lt;free-switch label="Switch"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" theme="primary"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" theme="info"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" theme="success"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" theme="warning"&gt;&lt;/free-switch&gt;
              &lt;free-switch label="Switch" theme="danger"&gt;&lt;/free-switch&gt;
            </free-code>
          </free-tab>
        </free-tab-group>
      </div>

      <div class="free-card-board">
        <h3 class="free-toolbar">Change Event</h3>
        <free-tab-group direction="right">
          <free-tab header="PREVIEW">
            <free-switch label="Switch" (onChange)="onChange($event)"></free-switch>
          </free-tab>
          <free-tab header="CODE">
            <free-code lang="html">
              &lt;free-switch label="Switch" (onChange)="onChange($event)"&gt;&lt;/free-switch&gt;
            </free-code>

            <free-code lang="javascript">
              onChange(event: any) &#123;
                console.log(event.target.checked);
              &#125;
            </free-code>
          </free-tab>
        </free-tab-group>
      </div>
    </div>
  </div>
  <blockquote>FreeNG - {{'MOTTO' | translate}}</blockquote>
</div>
